<template>
  <div class="detail" ref="containerRef">
    <a-affix :target="(containerRef as HTMLElement)">
      <a-page-header title="取消" @back="back" class="head"> </a-page-header>
    </a-affix>

    <!-- v-html="contentHtml" -->
    <div class="form-content">
      <iframe :srcdoc="contentHtml" width="100%" height="100%" frameborder="0" allowfullscreen></iframe>
    </div>
  </div>
</template>

<script setup lang="ts" name="DataDetail">
import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { usePagination } from '@/hooks'
import { Message } from '@arco-design/web-vue'
import { getscrapylibrary } from '@/apis'

const router = useRouter()
const route = useRoute()
const containerRef = ref<HTMLElement>()
const back = () => {
  router.back()
}
const contentHtml = ref('')
const getDetail = async () => {
  const { id } = route.params
  const resData = await getscrapylibrary({
    page: 1,
    pagesize: 1,
    ku_id: id
  })
  contentHtml.value = resData.data.data[0].article
}
getDetail()
</script>

<style lang="scss" scoped>
.detail {
  overflow: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  .head {
    background: var(--color-bg-1);
  }
  .item {
    margin: $margin;
    background: var(--color-bg-1);
    border-radius: 2px;
  }
  .form-content {
    flex: 1;
    overflow: auto;
    margin: $margin;
    background: var(--color-bg-1);
    padding: $padding;
    padding-bottom: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
}
</style>
